doorsname to username

is there a way to convert a user's doorsname to the system username using DXL?

I currently have many modules with an attribute filled in with doorsnames and I hope to be able to use some DXL script to find out what system username corresponds to the each doorsname that has already been filled in.

thanks!
emily_butt - Fri Feb 10 14:01:35 EST 2012

Re: doorsname to username
llandale - Fri Feb 10 19:41:59 EST 2012

You need "Manage User" powers, such as a DB Admin. Well, coding this quick I learned something new.

string GetSystemLoginName(string in_DoorsName)
{    // Get the System Login Name for the DoorsName
    if (!isUser(in_DoorsName))      return("NoSuchUser")
    if (getAdministratorName() == in_DoorsName)
    {       // Asking about the super user Admin.
                // Only that user can see its own User properties
       User usrCurr = find()
       UserClass uc = usrCurr.class
       if (uc != administrator)     return("CannotRead")
    }
    User usr = find(in_DoorsName)
    ensureUserRecordLoaded(usr)
    string SysName = usr.systemLoginName
    return(SysName)
} // end GetSystemLoginName()
 
 
void    Test(string in_DoorsName)
{
        print "[" in_DoorsName"]\t has System Login name: [" (GetSystemLoginName(in_DoorsName)) "]\n"
}
 
Test("landalo")
Test("xxx")
Test("Administrator")


-Louie

Re: doorsname to username
emily_butt - Tue Feb 14 08:25:08 EST 2012

llandale - Fri Feb 10 19:41:59 EST 2012

You need "Manage User" powers, such as a DB Admin. Well, coding this quick I learned something new.

string GetSystemLoginName(string in_DoorsName)
{    // Get the System Login Name for the DoorsName
    if (!isUser(in_DoorsName))      return("NoSuchUser")
    if (getAdministratorName() == in_DoorsName)
    {       // Asking about the super user Admin.
                // Only that user can see its own User properties
       User usrCurr = find()
       UserClass uc = usrCurr.class
       if (uc != administrator)     return("CannotRead")
    }
    User usr = find(in_DoorsName)
    ensureUserRecordLoaded(usr)
    string SysName = usr.systemLoginName
    return(SysName)
} // end GetSystemLoginName()
 
 
void    Test(string in_DoorsName)
{
        print "[" in_DoorsName"]\t has System Login name: [" (GetSystemLoginName(in_DoorsName)) "]\n"
}
 
Test("landalo")
Test("xxx")
Test("Administrator")


-Louie

Excellent! Thanks! This is exactly what I was looking for.

Re: doorsname to username
JSRowland - Thu Dec 22 19:10:59 EST 2016

llandale - Fri Feb 10 19:41:59 EST 2012

You need "Manage User" powers, such as a DB Admin. Well, coding this quick I learned something new.

string GetSystemLoginName(string in_DoorsName)
{    // Get the System Login Name for the DoorsName
    if (!isUser(in_DoorsName))      return("NoSuchUser")
    if (getAdministratorName() == in_DoorsName)
    {       // Asking about the super user Admin.
                // Only that user can see its own User properties
       User usrCurr = find()
       UserClass uc = usrCurr.class
       if (uc != administrator)     return("CannotRead")
    }
    User usr = find(in_DoorsName)
    ensureUserRecordLoaded(usr)
    string SysName = usr.systemLoginName
    return(SysName)
} // end GetSystemLoginName()
 
 
void    Test(string in_DoorsName)
{
        print "[" in_DoorsName"]\t has System Login name: [" (GetSystemLoginName(in_DoorsName)) "]\n"
}
 
Test("landalo")
Test("xxx")
Test("Administrator")


-Louie

Louie,

Not sure you'll see this all the way back in 2012, but thanks for answering this. My question is, how did you know that User.systemLoginName was a valid function? I was trying to do this same thing and even using Mathias' list of undocumented DOORS perms -- at least, the latest one I could find, which admittedly only covered through 9.2 -- gave me no solution. Do you just have a later version?